
/* Setup Rounting For All Pages */
App.config(['$stateProvider', '$urlRouterProvider', function($stateProvider, $urlRouterProvider) {
    $stateProvider
        .state('auth.reimburseAudit', {
            url: "/reimburseAudit",
            templateUrl: "views/reimburse/reimburseAudit.html",
            params: {'model': null},
            controller: "reimburseBillAuditController",
            resolve: {
                deps: ['$ocLazyLoad', function ($ocLazyLoad) {
                    return $ocLazyLoad.load([{
                        name: 'App',
                        files: [
                            'js/controllers/reimburse/reimburseBillAuditController.js'
                        ]
                    }]);
                }]
            }
        })
}]);

App.run(["$rootScope", '$templateCache', '$window', function($rootScope, $templateCache, $window) {
    //$templateCache.remove("layout/header.html");
}]);


App.factory('localStore',['$window',function($window){
    return{        //存储单个属性
        set :function(key,value){
            $window.localStorage[key]=value;
        },        //读取单个属性
        get:function(key,defaultValue){
            return  $window.localStorage[key] || defaultValue;
        },        //存储对象，以JSON格式存储
        setObject:function(key,value){
            $window.localStorage[key]=JSON.stringify(value);
        },        //读取对象
        getObject: function (key) {
            return JSON.parse($window.localStorage[key] || '{}');
        }
    };
}]);